package com.xyw.code.bus.common.entity.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.xyw.code.common.core.util.LongJsonDeserializer;
import com.xyw.code.common.core.util.LongJsonSerializer;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author xyw
 * @since 2020-02-26
 */
@TableName("sys_bus_log")
@Data
public class SysBusLog extends Model<SysBusLog> {

    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.ID_WORKER)
    @JsonDeserialize(using = LongJsonDeserializer.class)
    @JsonSerialize(using = LongJsonSerializer.class)
    private Long id;
    /**
     * 消息id
     */
    @TableField("bus_id")
    private Long busId;
    /**
     * 错误日志
     */
    @TableField("exception_log")
    private String exceptionLog;
    @TableField("create_time")
    private Date createTime;
    @TableField("modify_time")
    private Date modifyTime;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "SysBusLog{" +
        ", id=" + id +
        ", busId=" + busId +
        ", exceptionLog=" + exceptionLog +
        ", createTime=" + createTime +
        ", modifyTime=" + modifyTime +
        "}";
    }
}
